package com.zrq.secondkill.error;


import lombok.Getter;
import lombok.Setter;


public enum BusinessErrorEnum implements CommonError{

    //通用错误1000x
    PARAMETER_VALIDATION_ERROR(10001,"参数不合法"),
    UNKNOWN_ERROR(10002,"未知错误"),
    DATABASE_OPERATION_FAIL(10003,"数据库操作失败"),
    //用户信息相关错误2000x
    USER_NOT_EXIST(20001,"用户不存在"),
    USER_LOGIN_FAIL(20002,"用户手机号或密码不正确"),
    USER_NOT_LOGIN(20003,"用户还未登陆"),
    //交易信息相关错误3000x
    STOCK_NOT_ENOUGH(30001,"库存不足"),
    MQ_SEND_FAIL(30002,"库存异步消息失败"),

    ;

    @Getter
    private final Integer errCode;
    @Getter
    @Setter
    private String errMsg;

    BusinessErrorEnum(Integer errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }


}
